import request from '@/utils/request'
/**
 * 菜单列表
 */
export function getMenusListApi() {
  return request({
    url: '/menus',
    method: 'get'
  })
}

/**
 * 添加菜单
 */
export function addMenusApi(data) {
  return request({
    url: '/menus',
    method: 'post',
    data
  })
}

/**
 * 删除菜单
 */

export function delMenusApi(id) {
  return request({
    url: `/menus/${id}`,
    method: 'DELETE'
  })
}

/**
 * 菜单详情
 */

export function getMenusDetailApi(id) {
  return request({
    url: `/menus/${id}`,
    method: 'get'
  })
}

/**
 * 修改菜单
 */
export function editMenusDetailApi(id, data) {
  return request({
    url: `/menus/${id}`,
    method: 'PUT',
    data
  })
}
